#ifndef QCOMMONDELEGATE_H
#define QCOMMONDELEGATE_H

#include "corelib_global.h"

#include <QItemDelegate>
#include <QTreeWidget>

class QEditorCreator;

class CORELIBSHARED_EXPORT QCommonDelegate: public QItemDelegate
{
public :
    QCommonDelegate();
    void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
    QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
    QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
    void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const;

protected:
    QEditorCreator      *m_creator;
};

class CORELIBSHARED_EXPORT QCommonTreeWidget: public QTreeWidget
{
    Q_OBJECT
public:
    QCommonTreeWidget(QWidget* parent=0);
    void drawRow(QPainter *painter, const QStyleOptionViewItem &options, const QModelIndex &index) const;
};


#endif // QCOMMONDELEGATE_H
